<template>
  <div class="app-container">
         <!-- {{this.$route.params.code}} -->

  <el-form ref="form" :model="student" label-width="120px">
      <el-form-item label="学号:">
        <el-input v-model="student.code" />
      </el-form-item>
      <el-form-item label="姓名:">
        <el-input v-model="student.name" />
      </el-form-item>
      <el-form-item label="性别:">
        <el-input v-model="student.gender" />
      </el-form-item>
     <el-form-item label="所属学院:">
        <el-input v-model="student.department" />
      </el-form-item>
      <el-form-item label="专业:">
        <el-input v-model="student.major" />
      </el-form-item>
      <el-form-item label="班级:">
        <el-input v-model="student.clazz" />
      </el-form-item>
      <el-form-item label="家庭住址:">
        <el-input v-model="student.address" />
      </el-form-item>
      <el-form-item label="电话号码:">
        <el-input v-model="student.tel" />
      </el-form-item>
      <el-form-item label="邮箱:">
        <el-input v-model="student.email" />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit">确定</el-button>
        <el-button @click="onCancel">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  // import Vue from 'vue'
  // import axios from 'axios'
  // import VueAxios from 'vue-axios'


  // Vue.use(VueAxios, axios)

  // import {
  //   edit
  // } from '@/api/student/tableS'

  export default {
    data() {
      return {
        student: {
          code: '',
          name: '',
          gender: '',
          department: '',
          major: '',
          clazz: '',
          address: '',
          tel: '',
          email: '',
        }
      }
    },
    created() {
      this.fetchData();
    },
    methods: {
      // fetchData() {
      //    var vm = this;
      //         edit().then(res => {
      //           console.log(res.content);
      //           vm.student = res.content;
      //   })
      // },

      // fetchData() {
      //   var code = this.$route.params.code;
      //   var vm = this;
      //   this.axios({
      //     method: 'GET',
      //     url: 'http://localhost:8080/cms-web/student/getStudentByCode?code=' + code
      //   }).then(function(resp) {
      //     vm.student = resp.data;
      //     // console.log(resp.data);
      //   })
      // },
      onSubmit() {
        this.$message('submit!')
      },
      onCancel() {
        this.$message({
          message: 'cancel!',
          type: 'warning'
        })
      }
    }
  }
</script>

<style scoped>
  .line {
    text-align: center;
  }
</style>
